<template >
    <view class="follow">
		
        <follow-service
				:followed-id="followedId"
				desc="关注我，更多精彩爽剧不错过～"
				@follow="bindfollow"
				@error="followError"
				@openprofile="openprofile"
				:show-close-button="showCloseButton"
			></follow-service>
    </view>
</template>
<script>
export default {
	props: {
		
		compInfo: {
			type: Object,
			default: {}
		},
		list: {
			type: Array,
			default: () => {
				return [];
			}
		},
		showCloseButton:{
			type:Boolean,
			default:true
		}
	},
	data(){
		return{
           followedId:getApp().globalData.followedId,
		}
	},
	
	methods:{
		dianki(){
			console.log('dsjmfkdl')
		},
      bindfollow(e){
		  	console.log(e,'12121212')
			this.zwyRequest({
					method: 'post',
					url: '/cdp/user_subscribe/official_account?officialAccountAppId=' + this.followedId,
					
			}).then(res=>{
				if(res.subscribe){
					this.$statis({
						action: 'NOTICE_PAY_POINT'
					})
					this.$emit('follow')
				}
			})
	  },
	  followError(){
		  this.$statis({
			  action:'SHOW_NOTICE_FRAME'
		  })
	  },
	  openprofile(e){
		  this.zwyRequest({
					method: 'post',
					url: '/cdp/user_subscribe/official_account?officialAccountAppId=' + this.followedId,		
			}).then(res=>{
				if(res.subscribe){
					this.$statis({
						action: 'NOTICE_PAY_POINT'
					})
					this.$emit('follow')
				}
			})
		//   this.$statis({
		// 	  action:''
		//   })
	  }
	}
}
</script>
<style scoped>
.follow{
	padding-bottom: env(safe-area-inset-bottom);
}
</style>